The present invention relates to a distance measuring apparatus for measuring the distance to an object to be measured and, for example, a distance measuring apparatus suitably applied to an AF mechanism of a camera.
Japanese Patent Publication No. 5-22843 has proposed a distance measuring apparatus which integrates charges (electric charges) accumulated by photoelectric conversion elements by circulating them around a charge coupled device (to be referred to as CCD hereinafter) arranged in a ring pattern. The present applicant has also proposed Japanese Patent Application No. 7-263183 in association with the above patent publication. Each of these references has proposed a distance measuring apparatus which can attain by a single apparatus both a distance measurement mode using a light projection unit (active distance measurement mode) and a distance measurement mode without using any light projection unit.
FIG. 29 shows a distance measuring apparatus proposed by the above reference, to which the present invention can be applied.
Referring to FIG. 29, reference numeral 101 denotes a first light-receiving lens for forming a first optical path; 102, a second light-receiving lens for forming a second optical path; 103, a projection lens for projecting a beam spot onto the object to be measured; and 104, a light-emitting element (IRED) which is turned on/off to project beam spots. Reference numeral 105 denotes a first sensor array as a linear array of a plurality of photoelectric conversion elements; 106, a second sensor array having the same arrangement as that of the first sensor array 105; and 107, a first clear portion which provides an electronic shutter function of clearing charges photoelectrically converted by the respective sensors of the first sensor array 105. The first clear portion 107 clears charges in response to pulses ICG (Integration Clear Gate). Reference numeral 108 denotes a second clear potion which provides an electronic shutter function of clearing charges photoelectrically converted by the respective sensors of the second sensor array 106. The second clear portion 108 clears charges in response to pulses ICG as in the first electronic shutter (clear) portion 107.
Reference numeral 109 denotes a first accumulation portion which includes ON and OFF accumulation portions (not shown) and accumulates electric charges obtained from the first sensor array 105 in units of pixels in accordance with pulses ST (storage) 1 and ST2 synchronous with the ON and OFF periods of the light-emitting element 104. Reference numeral 110 denotes a second charge accumulation portion which accumulates charges obtained from the second sensor array 106 in units of pixels in accordance with pulses ST1 and ST2 synchronous with the ON and OFF periods of the light-emitting element 104, as in the first electric charge accumulation portion 109. Reference numeral 111 denotes a first charge transfer gate for parallelly transferring electric charges accumulated in the first electric charge accumulation portion 109 to a charge transfer unit (e.g., a CCD; to be described below) in response to pulses SH. Reference numeral 113 denotes a first charge transfer unit, which is locally or entirely constituted by a ring-shaped arrangement, and sums up charges respectively accumulated by the first electric charge accumulation portion 109 during the ON and OFF periods by circulating charges. The circulating portion will be referred to as a ring CCD 113b hereinafter, and a portion that does not constitute the circulating portion will be referred to as a linear CCD 113a hereinafter. Reference numeral 112 denotes a second transfer gate, which has the same arrangement as that of the first charge transfer gate 111. Reference numeral 114 denotes a second charge transfer unit, which has the same arrangement as that of the first charge transfer unit 113.
Reference numeral 115 denotes a first initialization unit, which performs initialization by resetting charges in the first charge transfer unit 113 in response to pulses CCDCLR. Reference numeral 117 denotes a first skim unit for resetting (discharging) a predetermined amount of charges. Reference numeral 118 denotes a second skim unit having the same function as that of the first skim unit 117. Reference numeral 119 denotes a first output unit for outputting a signal SKOS1 which is used for discriminating whether or not a predetermined amount of charges is to be reset. The first output unit 119 reads out the charge amount present in the first charge transfer unit 113 in a non-destructive manner while leaving them as charges. Reference numeral 120 denotes a second output unit for outputting a signal SKOS2 as in the first output unit 119. Reference numeral 121 denotes an output unit for sequentially reading out charges in the first charge transfer unit 113 and outputting a signal OS1. Reference numeral 122 denotes an output unit for outputting a signal OS2 in accordance with charges from the second charge transfer unit 114 as in the output unit 121. Reference numeral 123 denotes a first comparator for discriminating based on the signal SKOS1 if skimming is to be performed. Reference numeral 124 denotes a second comparator for performing the same discrimination as in the first comparator 123 on the basis of the signal SKOS2. Reference numeral 125 denotes a control unit including a CPU for making the overall control and calculations required for distance measurements.
As described above, the components 105, 107, 109, 111, and 113 constitute a first skim CCD sensor serving as a light-receiving unit, and the components 106, 110, 112, and 114 constitute a second skim CCD sensor serving as a light-receiving unit.
With the above-mentioned arrangement, the distance to the object to be measured can be calculated using the principle of so-called trigonometric measurements on the basis of the relative values of the positions on the first and second sensor arrays 105 and 106 using the signals OS1 and OS2.
In the above description, a apparatus for the active distance measurement mode using a light projection unit has been explained. In this apparatus, when the output corresponding to one of the ON and OFF periods is used without operating the skim units and without calculating any difference between charges corresponding to the ON and OFF periods of emission in the reading mode, the apparatus can serve as a distance measuring apparatus based on the phase difference using a normal line CCD. The active distance measurement mode using a light projection unit and the passive distance measurement mode without using any light projection unit in the above-mentioned apparatus will be explained, and their problems will be presented.
&lt;Description of First Problem&gt;
The first problem of the proposed hybrid type distance measuring apparatus will be described below with reference to FIGS. 30 to 33.
Referring to FIG. 30, reference numeral 1 denotes an object to be measured; 2, an IRED serving as a light-emitting element for projecting a beam spot; 3, a projection lens for transmitting light emitted by the IRED 2 and projecting it onto the object 1 to be measured; 4 and 5, light-receiving lenses for transmitting through light reflected by the object 1 to be measured; and 6 and 7, first and second sensor arrays for receiving the reflected light via the light-receiving lenses 4 and 5. On the output side of these first and second sensor arrays 6 and 7, electric charge accumulation portions for temporarily accumulating charges from the sensor arrays 6 and 7, charge transfer portions such as CCDs, charge reset portions for performing skimming, and the like are arranged, as in FIG. 29 above, and constitute skim CCD sensors together with these sensor arrays 6 and 7.
FIG. 31 is-a flow chart showing the outline of the operation when the distance measuring apparatus with the above arrangement performs distance measurements in the active mode.
In step S5001, the IRED 2 is turned on/off to project beam spots. In step S5002, the difference outputs between the received-light signals of the skim CCD sensors during the ON and OFF periods of the IRED 2 are calculated. Subsequently, in step S5003, charges from the sensor arrays 6 and 7 are integrated by circulating and adding the charges in synchronism with the ON and OFF periods of the IRED 2, and skimming for resetting (removing) external light components other than light components projected by the IRED 2 is performed during the integration.
The signal outputs are monitored, and when the difference outputs have exceeded a predetermined amount, light projection by the IRED 2 is stopped in step S5004. In step S5005, a correlation calculation is performed on the basis of the right and left difference outputs of signals of received-light images obtained by beam spots projected by the IRED 2. More specifically, the distance to the object to be measured is calculated using the principle of trigonometric measurements on the basis of the correlation values of the positions on the two sensor arrays of the difference outputs.
FIG. 32 is a flow chart showing the operation when the distance measuring apparatus with the above arrangement in FIG. 30 performs distance measurements in the passive mode.
In step S5101, the IRED 2 is turned off and set a normal output mode for outputting a received-light signal. Thereafter, in step S5102, resetting (skimming) of charges is inhibited. In step S5103, the received-light signals corresponding to the time required for one cycle of the operation of the light projection unit are obtained. In step S5104, a correlation calculation of the received-light signals obtained in step S5103 is performed. More specifically, the distance to the object to be measured is calculated using the principle of trigonometric measurements on the basis of the correlation values of the positions on the two sensor arrays.
FIG. 33 is a flow chart for explaining the outline of the distance measurement operation in the hybrid type distance measuring apparatus using the skim CCD sensors.
When distance measurements start, it is checked in step S5201 if skimming is allowed. If YES in step S5201, the flow advances to step S5203; otherwise, the flow advances to step S5204.
In step S5202, active distance measurements using signals obtained during the ON and OFF periods of the IRED 2 are performed. The operation in the active distance measurements is as described above with reference to FIG. 31. In step S5203, it is checked if a distance measurement value is obtained in step S5202. If a signal of the reflected beam spot cannot be obtained since the object to be measured is present at a far-distance position or has a low reflectance, it is determined that distance measurements are impossible to perform, and the flow advances to step S5204. If distance measurements are possible to perform, the distance measurements end. In step S5204, projection of the beam spot is inhibited, and passive distance measurements are performed. The operation in the passive distance measurements is as has been described above with reference to FIG. 32. After the distance measurement value is obtained, the distance measurement operation ends.
The above-mentioned distance measuring apparatus shown in FIG. 29 can perform an active distance measurement using a light projection unit and a passive distance measurement without any light projection unit using basically a common algorithm since distance measurements are performed using a single apparatus and a single optical system and by calculating the correlation between two image signals.
However, in practice, different noise components are generated in the active and passive distance measurements, and have the influence on the distance measurement performance.
More specifically, in the active distance measurement, the distance measurement performance deteriorates when the object to be measured is located at a far-distance position, and the image signal based on projected light becomes weak or shot noise due to external light components increases. Other words, in the active distance measurement, external light components are removed by calculating the difference between signals obtained during the ON and OFF periods of the light projection unit, so as to extract only an image signal obtained by the light projection unit. However, shot noise caused by external light remains even after the difference processing, thus impairing the S/N ratio. For this reason, for example, even when an active distance measurement is performed since skimming is allowed, the distance measurements become impossible to perform and it is determined that the object to be measured is located at infinity position. In such case, when the distance measurement precision lowers due to shot noise of external light, the lens is driven to infinity position even when the object to be measured is located at a middle-distance position, and as a consequence, an out-of-focus picture is taken.
Furthermore, when the electronic shutter function is activated, if the overall time remains the same, the actual signal accumulation time decreases, and the distance measurement performance deteriorates.
Furthermore, in the active distance measurement, in order to skim external light components, charges must circulate the ring CCD several times, and noise is generated depending on the number of rounds on the ring CCD.
In contrast to this, in the passive distance measurement, since external light is directly converted into an image signal, shot noise is suppressed to negligible level. In this mode, since an operation equivalent to that of a normal CCD is performed, no noise is generated irrespective of the number of rounds of the ring CCD.
As described above, the active and passive distance measurement methods suffer different noise problems. For this reason, upon discriminating the reliability of the distance measurement results obtained by these two distance measurement methods, if distance measurement errors are to be eliminated by increasing the discrimination level, distance measurements in the passive distance measurement method are often hampered, and the performance deteriorates. On the other hand, if the performance is to be improved by lowering the discrimination level, noise correlation is generated in the active distance measurement method, thus generating distance measurement errors.
As another criterion of the reliability, the overlapping ratio between two image signals is used. When the two image signals perfectly overlap and match each other, the highest reliability is obtained. However, in the conventional method, the distance measurement results of the two distance measurement methods often have low reliability. Furthermore, in the case of an AF camera that adopts the conventional distance measurement system, release time lags are generated due to delays of the distance measurement processing.
&lt;Description of Second Problem&gt;
The second problem in the distance measuring apparatus in FIG. 29 will be described with reference to FIGS. 34 to 43.
FIG. 34 is a diagram showing a distance calculation unit in the control unit 125 of the above distance measuring apparatus. Referring to FIG. 34, reference numeral 201 denotes an A/D converter for A/D-converting outputs OS1 and OS2 from the skim CCD sensors in synchronism with sampling pulses SP, and outputting the A/D-converted outputs to a CPU 204 (to be described below); 202, a reference voltage generator for supplying a reference voltage to the A/D converter 201; 203, an IRED driving unit for driving the IRED 104 serving as the light-emitting element in FIG. 29; and 204, a CPU for performing correlation calculations on the basis of the outputs from the A/D converter 201 to calculate the distance to the object to be measured, and controlling the overall distance measuring apparatus. Note that the sampling pulses SP are generated inside the skim CCD sensors.
FIG. 35 is a flow chart for explaining the operation in the passive distance measurements in the distance measuring apparatus along FIG. 34. In step S5301, a communication output mode for directly outputting received-light signals at the ON and OFF timings of the light projection unit is selected while the IRED 104 is kept OFF. In step S5302, resetting (skimming) of charges is inhibited. In step S5303, two image signals corresponding to the time required for one cycle of the operation of the light projection unit are supplied from the sensor arrays 105 and 106 to the A/D converter 201. In step S5304, the image signals are A/D-converted with reference to a reference voltage V.sub.C, and the converted signals are supplied to the CPU 204. In step S5304, a distance measurement value is obtained by calculating the correlation between the image signals obtained in step S5304. More specifically, the distance to the object to be measured can be calculated using the principle of so-called trigonometric measurements on the basis of the relative values of the positions, on the two sensor arrays 105 and 106, of the signals from these sensor arrays.
FIG. 36 is a flow chart for explaining the operation in the active distance measurements in the distance measuring apparatus along FIG. 34. In step S5401, the ON/OFF operation of the light projection unit is started. In step S5402, a mode for extracting the difference signal between received-light signals obtained during the ON and OFF periods of the light projection unit is selected. In step S5403, charges are added in synchronism with the ON and OFF periods of the light projection unit, and external light components are reset by skimming. When the difference signal has exceeded a predetermined amount while monitoring the signal output, the light projection unit is turned off in step S5404, and two image signals are supplied to the A/D converter 201. In step S5405, the image signals are A/D-converted with reference to the reference voltage V.sub.C, and the converted signals are supplied to the CPU 204. In step S5406, a distance measurement value is obtained by calculating the correlation between the difference signals of two received-light images. More specifically, the distance to the object to be measured can be calculated using the principle of so-called trigonometric measurements on the basis of the relative values of the positions of the difference signals on the two sensor arrays.
FIGS. 37A and 37B show actual distance measurements in the distance measuring apparatus. FIG. 37A shows passive distance measurements, and FIG. 37B shows active distance measurements.
Referring to FIGS. 37A and 37B, reference numeral 221 denotes an object to be measured in the passive distance measurement mode; and 222, an object to be measured in the active distance measurement mode. Reference numerals 101 and 102 denote first and second light-receiving lenses. Reference numeral 103 denotes a projection lens; 104, an IRED for projecting a beam spot; and 105 and 106, first and second sensor arrays each comprising a sensor block consisting of a plurality of photoelectric conversion elements. Light coming from the object 221 to be measured (FIG. 37A) or light projected by the IRED 104 and reflected by the object 222 to be measured (FIG. 37B) is incident on the first and second sensor arrays 105 and 106.
FIGS. 38A and 38B show image signals on the sensor arrays 105 and 106 in the passive distance measurement mode. The sensor array 105 comprises photoelectric conversion elements L1 to L8, and the sensor array 106 comprises photoelectric conversion elements R1 to R8. FIG. 38A shows the image signal on the sensor array 105, and FIG. 38B shows the image signal on the sensor array 106. In FIG. 38A, a received-light image is formed. across the elements L3 to L5, and in FIG. 38B, a received-light image is formed across the elements R3 to R5.
FIGS. 39A and 39B show the timings at which these signals shown in FIGS. 38A and 38B are accumulated and fetched in practice, and also show the output waveforms of image signal outputs OS1 and OS2 in FIG. 29. Upper image signal output waveforms OS1 and OS2 in FIGS. 39A and 39B are ideal ones, and waveforms OS1' and OS2' are the ones obtained when charges gradually flow into the transfer CCDs (such as ring CCDs or the like) due to dark current or external light components. In this case, as the A/D-conversion timing becomes later, the amount of unwanted electric charges accumulated increases. The reason why the waveforms OS1' and OS2' have different patterns is that charges corresponding to dark current or external light components flow into the transfer CCDs of the first and second sensor arrays 105 and 106 in different ways for some reason.
The outputs OS1 and OS2 (OS1' and OS2') shown in FIGS. 39A and 39B are obtained with reference to the reference voltage V.sub.C, and are expressed by downward convex signal output characteristics, as shown in FIGS. 39A and 39B. In FIGS. 39A and 39B, SP indicates the timing pulses used upon A/D-converting the outputs OS1 and OS2, 0 and 0' indicate the A/D-conversion timings of empty transfer portions (transfer portions including no signals) of the transfer CCDs in FIG. 29, and 1 to 8 indicate the A/D-conversion timings of the accumulated signals in the transfer CCDs in FIG. 29 of the respective photoelectric conversion elements outputs of the two sensor arrays. In FIGS. 39A and 39B, points A to D in the waveforms OS1' and OS2' should be noted. The levels at these points change as compared to those in the waveforms OS1 and OS2 since charges gradually flow into the transfer CCDs (ring CCDs or the like) due to dark current or external light components although these points correspond to the timings of empty transfer portions of the transfer CCDs. Note that A/D conversion is performed with reference to the reference voltage V, from the reference voltage generator 202 in synchronism with the above-mentioned pulses SP, and the sign of the A/D-converted output is inverted.
FIGS. 40A to 40D show the A/D conversion results of the outputs OS1 and OS2. FIGS. 40A to 40D respectively show the AID-converted waveforms corresponding to the waveforms OS1, OS2, OS1', and OS2' in FIGS. 39A and 39B. Ideally output two image signals shown in FIGS. 40A and 40B are nearly similar to each other, and accurate information can be obtained by performing correlation calculations for calculating the distance to the object to be measured. On the other hand, image signals shown in FIGS. 40C and 40D obtained when charges gradually flow into the transfer CCDs (ring CODs or the like) due to dark current or external light components are distorted, and accurate information cannot be obtained even when correlation calculations for calculating the distance to the object to be measured are performed. In the actual use state, especially, in the case of the distance measuring apparatus equipped in, e.g., a camera, the amount of charges corresponding to external light components flowing into the transfer CCDs (ring CCDs or the like) increases very much outdoors, and distance measurement errors occur with high possibility.
Active distance measurements performed when charges gradually flow into the transfer CCDs (ring CCDs or the like) due to dark current or external light components are as follows. Note that a description will be made for only one of a pair of sensor arrays for the sake of simplicity.
FIG. 41 shows the image signal on the sensor array 105 in the active distance measurement mode. The sensor array 105 comprises photoelectric conversion elements L1 to L8. In FIG. 41, a received-light image obtained upon receiving projected light reflected by the object to be measured is formed across the elements L3 to L5.
FIG. 42 shows the timings at which the signals shown in FIG. 41 are actually accumulated and fetched, and the output waveforms OS1 and OS1' of the image signal output portion in FIG. 29. In the active distance measurement mode, since signals are accumulated during both the ON and OFF periods of the light projection unit, the outputs OS1 appear in correspondence with both the ON and OFF periods of the light projection unit. The image signal output waveform OS1 in FIG. 42 is an ideal one, and the waveform OS1.varies. is obtained when charges gradually flow into the transfer CCD (e.g., a ring CCD) due to dark current or external light components. In this case, as the A/D conversion timing becomes later, the amount of unwanted electric charges accumulated becomes larger.
The output OS1 shown in FIG. 42 is obtained with reference to the reference voltage V.sub.C, and has downward convex signal output characteristics in FIG. 42 when a signal is present. Also, in FIG. 42, SP indicates the timing pulses upon AID-converting the output OS1, and 0a, 0b, 0a', and 0b' indicate the A/D conversion timings corresponding to empty transfer portions (i.e., transfer portions including no signals) of the transfer CCD in FIG. 29. Furthermore, 1a to 8a indicate the A/D conversion timings of the accumulated signals of the respective photoelectric conversion element outputs of the sensor array in the transfer CCD during the OFF period of the light projection unit, and 1b to 8b indicate the A/D conversion timings of the accumulated signals of the respective photoelectric conversion element outputs of the sensor array in the transfer CCD during the ON period of the light projection unit.
Note A/D conversion is performed with reference to the reference voltage V.sub.C from the reference voltage generator 202 in synchronism with the above-mentioned pulses SP, and the sign of the A/D-converted output is inverted.
FIGS. 43A and 43B show the outputs obtained by A/D-converting the outputs OS and calculating the differences between the signals obtained during the ON and OFF periods of the light projection unit. FIGS. 43A and 43B respectively show the A/D-converted waveforms corresponding to the waveforms OS1 and OS1' in FIG. 42. The ideal output image signal in FIG. 43A has a regularly shaped waveform, and can provide accurate information when this output is subjected to correlation calculations for calculating the distance to the object to be measured together with another output OS2 (not shown). On the other hand, even the output shown in FIG. 43B obtained when charges gradually flow into the transfer CCD (e.g., a ring CCD) due to dark current or external light components is free from any distortion although a difference from the charges in the neighboring transfer portions (signals during the ON and OFF periods of the light projection units) appears as an offset, and can provide accurate information when this output is subjected to correlation calculations for calculating the distance to the object to be measured together with another output OS2 (not shown). This is because signals obtained during the ON and OFF periods of the light projection unit are alternately transferred and output. In this fashion, the second problem need only be considered in the passive distance measurement mode alone.
&lt;Description of Third Problem&gt;
Not only in the distance measuring apparatus in FIG. 29 but in general, when the distance to a distant object is to be measured by the passive distance measurement method through a glass window using a camera, a good distance measurement result can be obtained without causing any distance measurement errors. However, in the active distance measurement method, a good distance measurement result cannot always be obtained. The active distance measurement method measures distance by receiving the reflected light of the light it projects. For this reason, when the distance to a distant object is to be measured through a window glass, light slightly reflected by the glass window adversely influences the distance measurement result.
In order to eliminate the adverse influence of the active distance measurement method, the present applicant has proposed a technique that can obtain an appropriate distance measurement result by detecting light reflected by the glass window surface using a dedicated light-receiving sensor even when the distance to a far object is measured through the glass window.
However, since the above-mentioned technique receives light using a dedicated sensor, the dedicated sensor is required in addition to normal sensors for distance measurements. For example, when the distance between the glass window and the distance measuring apparatus is slightly large (e.g., about 0.4 m), there is almost no reflected light between the glass window and the camera main body (or the distance measuring apparatus) and the dedicated sensor cannot receive the reflected light. As a consequence, the glass window cannot be normally detected, and the distance to the glass window is measured based on light regularly reflected by the glass window. When the distance measurement result (e.g., 0.4 m) falls outside the photographing interlocking range (e.g., within the closest-distance range) of the camera, a normal camera displays closest warning or inhibits photographing. For this reason, the picture of a distant object cannot be taken through the window glass, and the camera is not easy to operate.
Furthermore, in the above-mentioned technique, since the distance measurement result (or a photographing lens) is merely set at a predetermined distance suitable for photographing a distant object, the distance measurement result does not always have high precision.
&lt;Description of Fourth Problem&gt;
Not only in the distance measuring apparatus in FIG. 29 but in general, when distance measurements are performed using a hybrid type distance measuring apparatus, signals are accumulated in the active distance measurement mode, and signal charges are accumulated again in the passive distance measurement mode. In this case, the maximum total accumulation time that limits the respective total accumulation times of these modes uses an identical value for both the active and passive distance measurement modes in the conventional apparatus. However, an optimal value of the maximum total accumulation time in the active distance measurement mode does not always coincide with that in the passive distance measurement mode. The reason for such non-coincidence will be explained below.
FIG. 44 shows the relationship between the accumulation time and signal components and the relationship between the accumulation time and noise generated during charge transfer and charge accumulation in the active distance measurement mode. Assuming that the charge amount per accumulation is substantially constant, the accumulation time can be considered as the number of times of accumulation. A curve S1' represents the relationship between the signal level obtained when the distance to the object to be measured located at a relatively near-distance position is measured, and the number of times of accumulation, and a curve S1 represents the relationship between the signal level obtained when the distance to the object to be measured located at a far-distance position is measured, and the number of times of accumulation. It is considered that the signal level is proportional to the number of times of accumulation. A curve N1 represents the relationship between the level of noise generated by, e.g., charge transfer, and the number of times of accumulation. The noise is generated due to shot noise, the transfer efficiency of the charge transfer portion, and the like, and is assumed to be the sum of components proportional to the square root of the number of times of accumulation, components proportional to the number of times of accumulation, and residual components independent of the number of times of accumulation. Therefore, in the case of the active distance measurement mode, the S/N ratio is improved as the number of times of accumulation increases. However, since the accumulation time of signals is prolonged accordingly, the upper limit (Tmax) of the accumulation time is limited in association with the allowable distance measurement time.
FIG. 45 shows the relationship between the signal level and the noise level in the passive distance measurement mode in association with the brightness of the object to be measured. The accumulation time in the passive distance measurement mode is optimized, as indicated by a straight line R, in correspondence with the brightness of the object to be measured. More specifically, since the accumulation is repeated until the signal level reaches a predetermined value (S2), the number of times of electric charge accumulation is small (C1) when the object to be measured is bright (B1); the number of times of electric charge accumulation increases (C2) when the object to be measured is dark. However, since the noise increases in correspondence with the accumulation time, as described above, the S/N ratio is impaired as the number of times of accumulation increases. That is, in the passive distance measurement mode, when the object to be measured is bright, a high S/N ratio can be assured, but when the object to be measured is dark, the S/N ratio lowers. At the brightness of a point B3 in FIG. 45, the S/N ratio=1 is obtained, and even when the distance to the object to be measured with a brightness lower than that at the point B3 is measured, no reliable distance measurement result is obtained due to too low an S/N ratio. Accordingly, even when the electric charge accumulation is repeated beyond the number C3 of times of accumulation at that time, only the distance measurement time is prolonged, and the distance measurement performance cannot be improved. In the case of a camera, release time lags become larger.
&lt;Description of Fifth Problem&gt;
Not only in the distance measuring apparatus shown in FIG. 29 but in active type distance measuring apparatus, light projected by a light-emitting element and reflected by the object to be measured is received by a semiconductor position sensing device (to be referred to as a PSD hereinafter), and the reflected light position (the barycentric position of the reflected light) on the PSD is detected based on the output signal from the PSD, thereby calculating the distance to the object to be measured.
Since the barycentric position detection method is liable to cause distance measurement errors for a low-contrast object, a distance measuring apparatus in which a pair of parallel sensor arrays such as CCDs are arranged to receive the reflected light of the projected light, and the distance to the object to be measured is calculated based on the phase difference between the output signals from the pair of light-receiving elements, is known. FIGS. 46 and 47 are views for explaining the arrangement and operation of the distance measuring apparatus.
Referring to FIG. 46, reference numeral 251 denotes a light-emitting element for projecting a light beam toward the object to be measured. The light-emitting element 251 comprises an infrared light-emitting element (to be referred to as an IRED hereinafter), a light-emitting diode (LED) or the like (in the following description, the element 251 is assumed to be an IRED). Reference numeral 252 denotes a light projection driving unit for ON/OFF-controlling the IRED 251 in accordance with a signal from a microcomputer 264 (to be described later); 253, a projection lens for condensing the light beam projected by the IRED 251; and 254, an object to be measured. Reference numeral 255 denotes a first CCD serving as a light-receiving element array; 256, a second CCD serving as a light-receiving element array; and 257 and 258, light-receiving lenses for imaging the light projected by the IRED 251 toward the object to be measured and reflected by the object to be measured on sensor arrays of the first and second CCDs 255 and 256. Reference numeral 259 denotes an amplifier unit for amplifying a plurality of pieces of image information obtained by the CCDs 255 and 256; and 260, an A/D converter for quantizing the plurality of pieces of amplified image information (the quantized image information obtained by the A/D converter will be referred to as an image signal hereinafter). Reference numeral 261 denotes a storage unit (to be referred to as a RAM hereinafter) for temporarily storing the image signals quantized by the A/D converter 260.
Reference numeral 264A denotes a phase difference detection unit for detecting the phase difference between the image signals obtained by the CCDs 255 and 256 and stored in the RAM 261. The phase difference detection unit 264A detects a shift position corresponding to the peak value of the correlation amount, and calculates the phase difference between the image signals from the CCDs 255 and 256 by interpolation on the basis of the detected value. The calculation result is converted into the distance to the object to be measured using the principle of trigonometric measurements. Reference numeral 264B denotes a contrast discrimination unit for discriminating the presence/absence of distance measurement reliability by performing predetermined calculations of the image signals from the CCDs 255 and 256 and comparing the calculation results with a predetermined level; and 264, a microcomputer for controlling the distance measuring apparatus and performing distance measurement calculations.
The distance measurement operation of the distance measuring apparatus in FIG. 46 will be explained below with reference to the flow chart in FIG. 47.
Referring to FIG. 47, any residual charges in the CCDs 255 and 256 are reset in step S5501 before beginning electric charge accumulation. In step S5502, a timer (not shown) for measuring the electric charge accumulation time of each CCD by down-counting is started. The IRED 251 is turned on in step S5503, and electric charge accumulation of the CCDs 255 and 256 is started in step S5504. In step S5505, the levels of electric charges accumulated in the CCDs 255 and 256 are checked to prevent saturation. If the electric charge accumulation amount of one of the pair of CCDs 255 and 256 exceeds a predetermined level, the accumulation operation ends, and the flow advances to step S5507 to turn off the IRED 251. On the other hand, if the electric charge accumulation levels of the pair of CCDs 255 and 256 have not reached the predetermined level, the flow advances to step S5506.
In step S5506, the value of the timer (not shown) is monitored. If the value of the timer is not 0, the flow returns to step S5504 to continue the accumulation operation. If the value of the timer is 0, the accumulation operation ends, and the IRED 251 is turned off in step S5507. The accumulated electric charges are processed as image information, and are amplified by the amplifier unit 259. A plurality of pieces of image information are quantized by the A/D converter 260 in step S5508, and the quantized image signals of the CCDs 255 and 256 are stored in the RAM 261. In step S5509, a shift position corresponding to the peak value of the correlation amount is detected, and the phase difference between the image signals obtained by the CCDs 255 and 256 and stored in the RAM 261 is calculated by interpolation on the basis of the detected value. In step S5510, the contrast discrimination unit 264B performs contrast discrimination. In this contrast discrimination, the unit 264B performs the following calculation using each of the image signals of the CCDs 255 and 256: ##EQU1## where IM.sub.i is the image signal of the i-th pixel, IM.sub.i+i is the image signal of the (i+1)-th pixel, N is the total number of pixels of the CCD, and A is a discrimination constant set in advance by experiments. The calculation results CONT obtained using equation (1) above are compared with a contrast discrimination value which is set in advance by experiments. If one of the values calculated using equation (1) above is smaller than the discrimination value, since the amount of changes in image signals of the CCDs is small (low contrast), it is determined that the distance measurement result is "NG". If the discrimination result is "OK", the calculation result upon detecting the phase difference is converted into a distance to the object to be measured using the principle of trigonometric measurements in step S5512. Thereafter, the distance measurement ends. However, if the discrimination result is "NG", since the calculation result upon detecting the phase difference in step S5509 has low reliability, it is determined that the distance measurement result is "NG", and the distance measurement information is set to be a predetermined fixed value in step S5511.
In the above-mentioned distance measuring apparatus, the contrast discrimination result "NG" is obtained under the conditions that the object to be measured is located, with very high possibility, at a far-distance or infinity position the light beam projected by the IRED 251 cannot reach. For this reason, the fixed value is set to be a predetermined value corresponding to the far distance or an intermediate value that does not increase the defocus amount independently of the distance to the object to be measured within the distance range that generates the contrast discrimination result "NG".
As a modification of the above-mentioned distance measuring apparatus, in order to improve the distance measurement performance for a far-distance object, a distance measuring apparatus that performs a passive distance measurement when an active distance measurement provides a discrimination result of "NG" has been proposed. The block arrangement of this distance measuring apparatus is the same as that shown in FIG. 46, and its distance measurement operation is performed in accordance with the flow chart in FIG. 48. In FIG. 48, electric charge accumulation of the CCDs 255 and 256, A/D conversion, phase difference detection, and contrast discrimination are performed in steps S5501 to S5510 as in FIG. 46, and if the contrast discrimination result is "OK", the phase difference detected value is converted into distance information in step S5512. However, if the contrast discrimination result is "NG", passive distance measurements are performed in step S5511B, and thereafter, the distance measurement ends.
The operation in the passive distance measurements is performed in accordance with the flow chart in FIG. 49. Referring to FIG. 49, the residual charges in the CCDs 255 and 256 are reset in step S5601 before beginning electric charge accumulation. In step S5602, a timer (not shown) for measuring the electric charge accumulation time of each CCD by down-counting is started. In step S5603, accumulation of electric charges in the CCDs 255 and 256 is started. In step S5604, the levels of the electric charges accumulated in the CCDs 255 and 256 are checked to prevent saturation. If the amount of electric charges accumulated in one of the pair of CCDs 255 and 256 exceeds a predetermined level, the accumulation operation ends, and the flow advances to step S5606. On the other hand, if the levels of electric charges accumulated in the pair of CCDs 255 and 256 have not reached the predetermined level, the flow advances to step S5605. In step S5605, the value of the timer (not shown) is monitored. If the value of the timer is not 0, the flow returns to step S5603 to continue the accumulation operation. If the value of the timer is 0, the accumulation operation ends, and the flow advances to step S5606.
The accumulated electric charges are processed as image information, and are amplified by the amplifier unit 259. A plurality of pieces of image information are quantized by the A/D converter 260 in step S5606, and the quantized image signals of the CCDs 255 and 256 are stored in the RAM 261. In step S5607, a shift position corresponding to the peak value of the correlation amount is detected, and the phase difference between the image signals obtained by the CCDs 255 and 256 and stored in the RAM 261 is calculated by interpolation on the basis of the detected value. In step S5608, the contrast discrimination unit 264B performs contrast discrimination. In this contrast discrimination, the unit 264B calculates equation (1) above for the image signals of the CCDs 255 and 256, and compares the calculation results with a contrast discrimination value which is set in advance by experiments. If the discrimination result is "OK", the calculation result upon detecting the phase difference is converted into a distance to the object to be measured using the principle of trigonometric measurements in step S5610. Thereafter, the passive distance measurement operation ends. On the other hand, if the discrimination result is "NG", it is determined that the distance measurement result is "NG", and the distance measurement information is set to be a predetermined fixed value in step S5609. Thereafter, the passive distance measurement operation ends.
In the distance measuring apparatus that operates, as shown in FIG. 48, a passive distance measurement is executed under the conditions that the contrast discrimination result in the active distance measurement mode is NG, i.e., the object to be-measured is located, with very high possibility, at a far-distance or infinity position the light beam projected by the IRED 251 cannot reach. For this reason, the fixed value is set to be a predetermined value corresponding to the far distance or an intermediate value that does not increase the defocus amount independently of the distance to the object to be measured within the distance range that generates the contrast discrimination result "NG".
However, in the conventional distance measuring apparatus, the processing of the phase difference detection unit 264A is performed prior to the contrast discrimination processing. More specifically, phase difference detection is executed independently of the contrast discrimination result. Since the time required for the phase difference detection in the total distance measurement time is not negligibly short, the execution time of the phase difference detection when the contrast discrimination result is "NG" is very wasteful. In particular, in the distance measurement operation shown in FIG. 48, when the active distance measurement result is "NG", since the phase difference detection is performed twice in the active and passive modes, the distance measurement time is prolonged very much.